This page last changed on Feb 20, 2008 by scytacki.

For each expermient they will specify the setup of sensors they will need to use. It will look something like this:

<data_setup>
   <rate minimum="3" maximum="10"/>
   <sensors>
      <sensor quantity="temperature">
          <resolution min=".5" max="1"/>
          <device name="CCProbe">
              <param name="port" value="A"/>
          </device>
      <sensor>
      <sensor quantity="distance">
          <device name="CCProbe">
              <param name="port" value="B"/>
          </device>
      </sensor>
   </sensors>
</data_setup>

This configuration will be passed to the sensor library and then to the current sensor driver. The sensor driver will decide whether this is possible. And it will return a structure with information about the exact configuration that it will use. Right now this only contains the rate.

There might be extra configuration params embedded in the description that are specific to each device. However, with more examples some of these should be configurable automatically. If the device is known then the ports can be automatically selected. If the port if configured automatically then it needs to be available to the "technical hint" so it can say "plug in the sensor to port X"

There needs to be some extra configuration data sent to each vendors driver. This can be embedded in the data_setup.

For the native code this will be sent in a set of structures:

ExperimentConfig {
  float rate;
  float rateMin;
  float rateMax;
  // more toplevel experiment params??
  SensorConfig sensorConfigs[];
}

SensorConfig {
  int quantityType;
  float resolution;
  float resolutionMin;
  float resolutionMax;
  int numOfParams;
  SensorParam params [];
}

SensorParam{
  char *name;
  char *value;
}

The api for the native code will be:

/**
 * Send the function hooks (call backs) so the native code can notify us of data
 */
int init(CallBacks callBacks);

CallBacks {
  function int *dataArrived();
  function int *interfaceError(int code);
}

/**
 * Attempt to configure the interface for this experimental setup
 */
int configure(ExperimentConfig config);

/**
 * Get a structure that describes the needs of this driver
 */
DriverProperties getProperties();

DriverProperties {
  // This driver does not use a  thread or interupt to send data back
  // in this case the tick function will be called on a regular basis
  bool needsTick;
}

/**
 * If the driver needs a tick or heart beat then this method will be called
 * on a regular basis.
 */
int tick();

The vendor specific code will receive this configuration in a configure method. The method will return sucess or failure. And there will be a method for getting a description of this failure.

The java code that sits on top of this will handle the transforms.

Document generated by Confluence on Jan 27, 2014 16:55